#pragma once

#include "resource.h"
#include "FilterEdit.h"
#include <string>
using namespace std;

typedef list<FileStruct> LIST_FS;

class CRenameDlg : public CDialogImpl<CRenameDlg>, 
				   public CWinDataExchange<CRenameDlg>,		 
				   public CUpdateUI<CRenameDlg>
{
public:
	enum { IDD = IDD_RENAMEDLG };

	BEGIN_UPDATE_UI_MAP(CRenameDlg)
	END_UPDATE_UI_MAP()

	BEGIN_MSG_MAP(CRenameDlg)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		MESSAGE_HANDLER(WM_CLOSE, OnClose)
		COMMAND_ID_HANDLER(IDC_RENAME_OK, OnOk)
		COMMAND_ID_HANDLER(IDC_RENAME_CANCEL, OnCancel)
	END_MSG_MAP()

	BEGIN_DDX_MAP(CRenameDlg)
		DDX_TEXT(IDC_FILE_NAME, m_sFileName)
	END_DDX_MAP()

	CRenameDlg(CString sFileName,string sFileID,LIST_FS& lfList);

	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnOk(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

protected:
	CString m_sFileName;
	CFilterEdit m_fEdit;
	string m_sFileID;
	LIST_FS& m_lfList;
};